import Vue from 'vue'
let utils = {
    install(Vue) {
        Vue.prototype.$location = function MP() {
            return new Promise(function (resolve, reject) {
                window.onload = function () {
                    resolve(window.BMap)//插入script标签后 会在window上挂一BMap属性,此为跨域获取的数据
                };
                var script = document.createElement("script");
                script.type = "text/javascript";
                script.src = "http://api.map.baidu.com/api?v=2.0&ak=NhqZ8yzUMrCzb4XDAoOX60yG5dRPGfQn&callback=init";
                script.onerror = reject;
                document.head.appendChild(script);//插入此标签后 会在window上挂一BMap属性,此为跨域获取的数据
            })
        }
    }
}

Vue.use(utils);
// import VueAMap from 'vue-amap';

// Vue.use(VueAMap);
// VueAMap.initAMapApiLoader({
//   key: 'e7386e5de8be52fd4ce3c2d283abf560',
//   plugin: ['AMap.Geolocation'],
//   v: '1.4.4',//高德 sdk 版本为 1.4.4
// });